package com.hkd.cya.原型模式;

import com.hkd.cya.策略模式加简单工厂.SalesMan;

public class StudentPrototype implements Cloneable{
    private String name;
    private String id;

    public StudentPrototype(String name, String id) {
        System.out.println("****构造函数实例化对象****");
        this.name = name;
        this.id = id;
    }

    public StudentPrototype() {
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "姓名："+name+",学号："+id;
    }

    @Override
    protected StudentPrototype clone() throws CloneNotSupportedException {
        System.out.println("****克隆出来的实例对象****");
        return(StudentPrototype) super.clone();
    }
}
